<template>
  <div id="app">
    <div id="nav" v-if="$route.meta.flag">
      <router-link :to="item.path" v-for="(item,index) in footer" :key="index"><img :src="item.src" alt=""><p>{{item.title}}</p></router-link>
    </div>
    <router-view/>
  </div>
</template>

<style lang="less">
  *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
  }
  #nav{
    width: 100%;
    height: 50px;
    display: flex;
    background: white;
    justify-content: space-around ;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1;
    a{
      font-size: 12px;
      flex: 1;
      text-align: center;
      color: black;
    }
    img{
      width: 24px;
      height: 24px;
    }
  }
</style>

<script>
  export default {
      data(){
          return{
            footer:[
              {
                path:"/",
                src:"img/home1.png",
                title:"首页",
              },
              {
                path:"/store",
                src:"./img/store1.png",
                title:"商店",
              },
              {
                path:"/car",
                src:"img/car1.png",
                title:"购物车",
              },
              {
                path:"/mine",
                src:"img/mine1.png",
                title:"我的",
              },
            ],
          }
      },
      methods:{

      },
      // mounted(){
      //   if(localStorage.getItem('biao1')==null){
      //     this.$store.state.arr=[];
      //   }else{
      //     this.$store.state.arr=JSON.parse(localStorage.getItem('biao1'));
      //   }
      // },
      // updated(){
      //   if(localStorage.getItem('biao1')==null){
      //     this.$store.state.arr=[];
      //   }else{
      //     this.$store.state.arr=JSON.parse(localStorage.getItem('biao1'));
      //   }
      // },
  }
</script>
